13. Quiz: Writing a For...of Loop (1-4)
Directions:
Write a for...of loop that:
- loops through each day in the
daysarray - capitalizes the first letter of the day
- and prints the day out to the console
Your code should log the following to the console:
Sunday
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Your Code:
Start Quiz:
/*
* Programming Quiz: Writing a For...of Loop (1-4)
*/
const days = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
// your code goes here
User's Answer:
(Note: The answer done by the user is not guaranteed to be correct)
/*
* Programming Quiz: Writing a For...of Loop (1-4)
*/
const days = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
// your code goes here
for (let day of days) {
console.log(day.charAt(0).toUpperCase() + day.slice(1));
}